home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / program / tpwpxeng.zip / RECLOCK.PAS < prev    next >
Pascal/Delphi Source File  |  1991-07-22  |  689b  |  31 lines

  1. program RecLock;
  2. uses PXEngine, WinCrt;
  3.  
  4. const TableName = 'Table';
  5.  
  6. var   PxErr: Integer;
  7.       TblHandle: TableHandle;
  8.       RecHandle: RecordHandle;
  9.       LckHandle: LockHandle;
  10.  
  11. procedure PX(Code : integer);
  12. begin
  13.   writeln(PXErrMsg(Code));
  14. end;
  15.  
  16. begin
  17.   PX(PXWinInit('MyApp', pxShared));
  18.   PX(PXTblOpen(TableName, TblHandle, 0, False));
  19.   PX(PXRecBufOpen(TblHandle, RecHandle));
  20.  
  21.   (* Attempt to lock current record *)
  22.   PxErr := PXNetRecLock(TblHandle, LckHandle);
  23.   if PxErr <> PxSuccess then
  24.     Writeln(PxErrMsg(PxErr))
  25.   else PX(PXNetRecUnlock(TblHandle, LckHandle));
  26.  
  27.   PX(PXRecBufClose(RecHandle));
  28.   PX(PXTblClose(TblHandle));
  29.   PX(PXExit);
  30. end.
  31.